<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>数组中使用对象方式绑定class属性</title>
  <script type="text/javascript" src="vue.js"></script>
  <style>
    div>div {
      width: 60px;
      height: 60px;
      border: 2px solid #bbb;
      text-align: center;
      line-height: 60px;
      font-size: 30px;
      margin:10px;
      float:left;
    }
    .selected{
      border-color: #000;
    }
    .active{
      background: #bbb;
    }
  </style>
</head>
<body>
  <div id="app">
    <div v-bind:class="[{active: className1}, className2]">vue</div>
  </div>
  
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        className1: true,
        className2: 'selected'
      }
    })
  </script>
</body>
</html>